#-*- coding: utf-8 -*-
__author__ = 'lieber'

#-*- coding: utf-8 -*-
__author__ = 'lieber'

import re
import jsonpath
import jsonpath
from utils.myrequest import MyRequest


url = 'http://open-sit.kyepm.com/security/token'
headers = {'X-from ': 'openapi_app', 'content-type': 'application/json;charset=UTF-8' }
request_data = {
    "appkey": "50027",
    "appsecret": "0C71E12062B60EDC4BB9CEFB4B914BD0"
}
res = MyRequest().send_post(url=url, headers=headers, json=request_data)
print(res.text)
#token = res.json()['data']['refresh_token']
#print(token)
url = 'http://open-sit.kyepm.com/router/rest?pda.pickupgoodsLabel.save'
headers = {'content-type': 'application/json;charset=UTF-8', 'format': 'JSON', 'appkey': '50027', 'token':'', 'method': 'pda.pickupgoodsLabel.save'}
request_data = {
   "waybillNumber": "20181207056",
   "printEmployeeId": "1066539240410648583",
   "printEmployeeName": "张先伟",
   "printTime": 1544178288000,
   "printDepartmentId": "11190",
   "printDepartmentName": "石岩中运点部",
   "pdaId": "0",
   "pdaNumber": "C008A0007000",
   "pdaMac": "DC:1D:30:2D:50:94",
   "startPage":"1",
   "endPage":"5",
   "count":"5"
}
res = MyRequest().send_post(url=url, headers=headers, json=request_data)
print(res.text)
